<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Untitled Document</title>
	<script type="text/javascript" language="javascript1.3" src="../../release/Popup.js">
		// ie6 check
	</script>
	
	<script>
		window.onload = function(){
			if( window.opener ){
				var button = document.getElementsByTagName('button')[1];
				button.style.display = 'block';
			}
			window.windowPopup = new Popup('index.html');
			windowPopup.registerCallBack(function(data){
				console.log( data );
			});
			
		}
	</script>
</head>

<body>
	<button onclick="window.windowPopup.open();">Popup open</button>
	<button class="close" style="display:none" onclick="Popup.callRegisteredCallback({'data':'to_return'}); Popup.close();">return data and close</button>
</body>
</html>
